package com.cn.ycy.websocket;

import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;

/**
 * 消息处理器
 *
 * @author dyw
 * @date 2020年6月23日
 */
public class EchoHandler extends TextWebSocketHandler {

  @Override
  protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
    session.sendMessage(new TextMessage(message.getPayload()));
    System.out.println(new TextMessage(message.getPayload()));
  }

}
